package cn.intotw.pp.server.config;
import lombok.extern.log4j.Log4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Enumeration;
import java.util.ResourceBundle;

/**
 * @author Chenxiang
 * @Description: 服务器配置文件加载
 * @create 2018/8/15 16:28
 */
@Log4j
public class ServerConfig implements Configuer{
    private static ResourceBundle resourceBundle;

    public void initConfig() {
        resourceBundle=ResourceBundle.getBundle("serverConfig");
        if(resourceBundle!=null)
        {
            log.info("配置文件构建完毕");
        }
        log.info("配置文件加载内容：");
        Enumeration<String> keys= resourceBundle.getKeys();
        String key;
        while (keys.hasMoreElements())
        {
            key=keys.nextElement();
            log.info(String.format("参数%s :%s",key,resourceBundle.getString(key)));
        }
    }

}